﻿using System;
using DomainExample.DomainModel.ContactModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace DomainExample.Repository.Tests.ContactRepositoryTests
{
    [TestClass]
    public sealed class ContactRepositoryRemoveTests : ContactRepositoryTests
    {
        [TestInitialize]
        public void SetUp()
        {
            CreateSchema();
        }

        [TestCleanup]
        public void TearDown()
        {
            DestroySchema();
        }

        [TestMethod]
        [TestCategory("Database Integration")]
        public void ContactRepositoryRemoveExpectRemoved()
        {
            var testContact = AddTestContact(DateTime.Now, ContactType.Telephone, DirectionType.Inbound, "Example");

            Target.Remove(testContact.Id);

            var result = Target.GetById(testContact.Id);
            Assert.IsNull(result);
        }
    }
}
